package com.iris.live.services.data.repositories;

import com.iris.live.services.data.models.UpdateInfoModel;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * Created by SallyGo on 2016/12/10.
 */
public interface PCUpdateRepository extends JpaRepository<UpdateInfoModel, Integer>, JpaSpecificationExecutor<UpdateInfoModel> {
    @Query(value = "select * from update_info a where INSTR(a.dlcode, ?1) > 0 and a.platformState=?2", nativeQuery = true)
    List<UpdateInfoModel> getNowVerByCode(String code, String state);

    @Query("select a from UpdateInfoModel a where a.dlcode is null and a.platformState=?1")
    List<UpdateInfoModel> getNowVerByNull(String state);
}
